home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- //
- // Creation Date: June 16, 1997
- // Author: sw
- //
- // Procedure Name:
- // AEhyperLayoutTemplate
- //
- // Description Name;
- // Creates the attribute editor controls for the hyperLayout node
- //
- // Input Value:
- // nodeName
- //
- // Output Value:
- // None
- //
-
-
- //
- // Procedure Name:
- // AEhyperLayoutImageNameNew
- //
-
- global proc AEhyperLayoutImageNameNew (string $fileAttribute)
- {
- setUITemplate -pst attributeEditorTemplate;
- rowLayout -nc 3 hyperLayoutImageNameLayout;
- text -l "Image Name";
- textField hyperLayoutImageNameField;
- symbolButton -image "navButtonBrowse.xpm" browser;
- setParent ..;
- setUITemplate -ppt;
-
- AEhyperLayoutImageNameReplace $fileAttribute;
- }
-
- //
- // Procedure Name:
- // AEhyperLayoutImageNameReplace
- //
-
- global proc AEhyperLayoutImageNameReplace (string $fileAttribute)
- {
- string $nodeName[];
- tokenize($fileAttribute, ".", $nodeName);
- string $hyperPanel[] = `getPanel -scriptType hyperGraphPanel`;
- string $editor = ($hyperPanel[0] + "HyperGraphEd");
-
- scriptJob -p hyperLayoutImageNameField -rp
- -ac $fileAttribute
- ("AEhyperLayoutUpdateImageName "+$fileAttribute);
- scriptJob -p hyperLayoutImageNameField
- -ac ($nodeName[0] + ".imageScale")
- ("hyperGraph -e -forceRefresh " +$editor);
-
- string $command = "loadHyperGraphImage "+" "+$fileAttribute;
-
- button -e -c $command browser;
-
- string $command = "loadHyperGraphImageCB "+" "+$fileAttribute;
-
- textField -e -cc "loadHyperGraphImageCB \"#1\"" hyperLayoutImageNameField;
- }
-
- global proc AEhyperLayoutUpdateImageName (string $fileAttribute)
- {
- string $value = `getAttr $fileAttribute`;
- textField -e -tx $value hyperLayoutImageNameField;
- }
-
- global proc int loadHyperGraphImageCallback ( string $theFile, string $theFileType )
- {
- string $hyperPanel[] = `getPanel -scriptType hyperGraphPanel`;
- string $editor = ($hyperPanel[0] + "HyperGraphEd");
-
- // Optional retaining of the new directory.
- string $currentDir = `workspace -q -dir`;
- // retainWorkingDirectory $currentDir;
-
- // Do stuff with $theFile
- // file -i -type $theFileType $theFile; // Or whatever.
- hyperGraph -e -image $theFile $editor;
- hyperGraph -e -imageEnabled true $editor;
- return 1;
- }
-
- global proc int loadHyperGraphImageCB ( string $theFile )
- {
- string $hyperPanel[] = `getPanel -scriptType hyperGraphPanel`;
- string $editor = ($hyperPanel[0] + "HyperGraphEd");
-
-
- // Optional retaining of the new directory.
- string $currentDir = `workspace -q -dir`;
- hyperGraph -e -image $theFile $editor;
- hyperGraph -e -imageEnabled true $editor;
- return 1;
- }
-
- global proc loadHyperGraphImage(string $fileAttribute)
- {
- string $hyperPanel[] = `getPanel -scriptType hyperGraphPanel`;
- string $editor = ($hyperPanel[0] + "HyperGraphEd");
-
- $myWorkspace = `workspace -q -fn`;
- setWorkingDirectory($myWorkspace, "image", "images");
- fileBrowser loadHyperGraphImageCallback "Load Image" "image" 0;
- }
-
-
- global proc AEhyperLayoutTemplate ( string $nodeName )
- {
- editorTemplate -beginScrollLayout;
-
- editorTemplate -beginLayout "Hyper Layout Attributes" -collapse 0;
- editorTemplate -callCustom "AEhyperLayoutImageNameNew"
- "AEhyperLayoutImageNameReplace"
- "imageName";
- editorTemplate -addControl "imageScale";
- editorTemplate -endLayout;
-
- // suppressed attributes
- editorTemplate -suppress "imageName";
-
-
- // include/call base class/node attributes
- AEdependNodeTemplate $nodeName;
-
- editorTemplate -addExtraControls;
- editorTemplate -endScrollLayout;
- }
-